package com.flot.yazb.base.adapter.recycleview;

import android.content.Context;

import java.util.List;

/**
 * Created by Chexiangjia-MAC on 17/6/29.
 */

public abstract class BRAdapter<T> extends RVAdapter<T> {


    protected Context mContext;

    public BRAdapter(final Context context, final int layoutId, List<T> datas)
    {
        super(context, datas);
        mContext = context;
        addItemViewDelegate(new ItemViewDelegate<T>() {
            @Override
            public int getItemViewLayoutId() {
                return layoutId;
            }

            @Override
            public boolean isForViewType(T item, int position) {
                return true;
            }

            @Override
            public void converts(RvHolder holder, T t, int position) {
                BRAdapter.this.convert(holder, t, position);
            }
        });
    }



    protected abstract void convert(RvHolder holder, T t, int position);
}
